package net.towee.model.repo;

import java.util.Date;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Model of repo tree node data 
 * @author c58
 */
public interface NodeData extends IsSerializable {
	/**
	 * @return Id of
	 */
	String getId();
	
	/**
	 * @return id of owned group
	 */
	String getGroupId();
	
	/**
	 * Set group id
	 * @param groupId
	 */
	void setGroupId(String groupId);
	
	/**
	 * @return id of parent node
	 */
	String getParentId();
	
	/**
	 * set parent node id
	 * @param id
	 */
	void setParentId(String id);
	
	/**
	 * @return path to this node in tree in format: a/b/c
	 * 		   where a,b and c name of parent nodes of this node.
	 * 		   Each name base64 encoded
	 */
	String getPath();
	
	/**
	 * Set new path to this node
	 * @param path
	 */
	void setPath(String path);
	
	/**
	 * @return date of creation
	 */
	Date getCreationDate();
	
	/**
	 * @return DocumentNode object if this is it. Null otherwise
	 */
	DocumentNode toDocumentNode();
	
	/**
	 * @return TreeNode object if this is it. Null otherwise
	 */
	TreeNode toTreeNode();

	/**
	 * @return path for children nodes
	 */
	String getPathForChildren();

	/**
	 * @return name of node
	 */
	String getName();
	
	void setName(String name);

	void setId(String string);

	void setCreationDate(Date date);
}
